package com.ucode.model.hrm;

import com.ucode.model.hrm.enums.HrmSocialSecurityCoverageTypeEnum;
import com.ucode.tool.validator.InEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * 社保规则项
 * @Author: liliang
 * @Date: 2025/6/7 14:41
 * @Version: 1.0
 */
@Schema(description = "人力资源管理系统 - 社保规则项")
@Data
@EqualsAndHashCode
@ToString(callSuper = true)
public class HrmSocialSecurityRuleItem {
    /**
     * 社保项类型名称
     */
    @Schema(description = "社保分类项", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "社保分类项不能为空")
    @InEnum(value = HrmSocialSecurityCoverageTypeEnum.class)
    private Integer coverageType;
    /**
     * 基数金额
     */
    @Schema(description = "基数金额", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "基数金额不能为空")
    @Min(value = 0, message = "基数金额最小值为0")
    private BigDecimal baseAmount;
    /**
     * 个人缴费比例
     */
    @Schema(description = "个人缴费比例", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "个人缴费比例不能为空")
    @Range(min = 0, max = 10, message = "个人缴费比例范围在0%-10%之间")
    private Double personalRate ;
    /**
     * 单位缴费比例
     */
    @Schema(description = "单位缴费比例", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "单位缴费比例不能为空")
    @Range(min = 0, max = 20, message = "单位缴费比例范围在0%-20%之间")
    private Double companyRate ;

}
